package kr.hkit.PowerJava.chapter07.work;

public class Eworld {
      private int gubun;
      private int age;
      private int hour;
    
 public Eworld(int gubun, int age, int hour){
	   this.gubun = gubun;
	   this.age = age;
	   this.hour = hour;
 }
          
public int getPrice(){
	int price = 0;
	if (this.gubun == 1){     //자유이용권
	   if(hour > 16){         //야간
		    if (age <3){      //영아
		    	price =0;
		    	
		    }else if (age < 13 || age > 64){     //소인
		    	price = 21000;
		    }else{
	            price = 29000;
		    }
	   }else{
		   if (age <3){      //영아
		    	price =0;
		    	
		    }else if (age < 13 || age > 64){     //소인
		    	price = 25000;
		    }else{
	            price = 34000;
		    }
	   }
	   }else{
	      if(hour >16){ 
		   if (age <3){      //영아
	    	price =0;
	    	
	    }else if (age < 13 || age > 64){     //소인
	    	price = 20000;
	    }else{
           price = 27000;
	    }if (age <3){      //영아
	    	price =0;
	    	
	    }else if (age < 13 || age > 64){     //소인
	    	price = 17000;
	    }else{
            price = 23000;
	    }
return price;
	}
}
}
}

